package com.probox.common.entity.domain.order;

import java.util.Date;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.probox.common.core.enums.ServiceStatusEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.*;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.probox.common.core.annotation.Excel;

/**
 * 订单售后节点对象 order_post_sale_node
 *
 * @author hds
 * @date 2021-07-12
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("order_post_sale_node")
@ApiModel(description = "订单售后节点")
public class OrderPostSaleNode implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 节点ID
     */
    //默认主键自增
    @TableId(value = "NODE_UID", type = IdType.AUTO)
    @ApiModelProperty(value = "节点ID")
    private Long nodeUid;

    /**
     * 售后ID
     */
    @Excel(name = "售后ID")
    @ApiModelProperty(value = "售后ID")
    private Long serviceUid;

    /**
     * 节点状态(0取消售后,1申请待处理,2处理中,3拒绝售后,4同意售后,,5售后完成)
     */
    @Excel(name = "节点状态(0取消售后,1申请待处理,2处理中,3拒绝售后,4同意售后,,5售后完成)")
    @ApiModelProperty(value = "节点状态(0取消售后,1申请待处理,2处理中,3拒绝售后,4同意售后,,5售后完成)")
    private String nodeStatus;

    /**
     * 节点描述
     */
    @Excel(name = "节点描述")
    @ApiModelProperty(value = "节点描述")
    private String nodeDesc;

    /**
     * 创建人
     */
    @Excel(name = "创建人")
    @ApiModelProperty(value = "创建人")
    private Long createUser;

    /**
     * 创建人名称
     */
    @Excel(name = "创建人名称")
    @ApiModelProperty(value = "创建人名称")
    private String createName;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;


    public String getNodeStatus(){
        return ServiceStatusEnum.getNameByKey(nodeStatus);
    }


    public OrderPostSaleNode(Long serviceUid, String nodeStatus, String nodeDesc, Long createUser, String createName, Date createTime) {
        this.serviceUid = serviceUid;
        this.nodeStatus = nodeStatus;
        this.nodeDesc = nodeDesc;
        this.createUser = createUser;
        this.createName = createName;
        this.createTime = createTime;
    }
}
